tests: Small tweaks for local iteration
authorColin Walters <walters@verbum.org>
Thu, 22 Mar 2018 16:45:51 +0000 (12:45 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 22 Mar 2018 19:01:52 +0000 (19:01 +0000)
Support e.g. `-e tests=payload-link`, to choose specific tests for more rapid
iteration, and allow skipping tmpdir cleanup to be able to debug.

Closes: #1509
Approved by: jlebon

tests/fedora-str/sysinstall-tests.yml
tests/installed/libinsttest.sh

index 88b289d43cc447e70952b1d44a85f056b9cbc7e7..58f216aef215ff990ad295105ec4bb41762a1ad1 100644 (file)
@@ -6,6 +6,7 @@
   remote_user: root
   vars:
     use_git_build: True
+    tests: ""
   tasks:
     - import_tasks: overlay-git.yml
       when: use_git_build
@@ -15,6 +16,8 @@
     # Down the line perhaps do each log file separately?
     - name: Run shell script sysinstalled tests
       shell: /root/tests/installed/run.sh &> /root/installed-tests.log
+      environment:
+        TESTS: "{{ tests }}"
       register: sysinstalled_result
       failed_when: False
     - name: Fetch sysinstalled results
index 6d6ba50c41e0ee2a99d7be351ed6a1dc58ff4ced..96da9545479955a5ecd4f1952aed370886f7bd34 100644 (file)
@@ -25,7 +25,8 @@ dn=$(dirname $0)
 # Copy of bits from tap-test
 test_tmpdir=
 function _tmpdir_cleanup () {
-    if test -n "${test_tmpdir}" && test -f ${test_tmpdir}/.testtmp; then
+    if test -z "${TEST_SKIP_CLEANUP:-}" &&
+       test -n "${test_tmpdir}" && test -f ${test_tmpdir}/.testtmp; then
              rm "${test_tmpdir}" -rf
     fi
 }